<script>
  var b = 10;
  (function b() {
    b = 20;
    console.log(window.b);
    console.log(b);
  })();
  console.log(b);
</script>